<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        //对象的定义方式
        //1.字面量或直接量语法
        var obj = {
            "name": "zhangsan",
            age: 40,
            'say': function() {
                return 300;
            }
        };
        console.log(obj.name);
        console.log(obj.say());
        new Object(); //实例化内置构造函数 得到 实例化对象-- - 实例对象
        var obj1 = new Object();
        var obj1 = new Object; //后面的小括号可加可不加，推荐还是加上
        console.log(obj1); //得到一个空对象
        //var obj1 = {};
    </script>
</body>

</html>